package libs.wenshi.com.test;



import android.util.Log;

import com.wenshi.app.activity.WsReFreshAndLoadMoreActivity;
import com.wenshi.view.IKeyValue;
import com.wenshi.view.WsViewMapData;

import java.util.ArrayList;
import java.util.HashMap;


public class ListMoreActivity extends WsReFreshAndLoadMoreActivity {


    private int start = 0;
    @Override
    public void onReLoadContent() {

    }

    @Override
    public void __onCreate() {
        Log.e("initdata","333");
        initAdapterData(getData(),R.layout.list_item_1);
    }

    @Override
    public void onRefresh() {
        start=0;
        initAdapterData(getData(),R.layout.list_item_1);

    }

    @Override
    public void onLoadMore() {
    addAdapterData(getData());
    }

    private ArrayList<IKeyValue> getData() {
        ArrayList<IKeyValue> list = new ArrayList<>();

        HashMap<String, String> map;


        for (int i = 0; i < 20; i++) {
            start = start+1;
            map = new HashMap<String, String>();
            map.put("title", "G" + start);
            map.put("info", "google " + start);
            map.put("type", (start % 2) + "");
            list.add(WsViewMapData.from(map));

        }


        return list;
    }
}
